import Antd from 'ant-design-vue'
import { createPinia } from 'pinia'
import { createApp } from 'vue'
import { createPermissionGuard } from '@/router/guard/permission'
import { setupErrorHandler } from '@/utils/errorHandler'
import App from './App.vue'
import router from './router'
import 'virtual:svg-icons-register'

import 'ant-design-vue/dist/reset.css'
import './styles/main.css'

const app = createApp(App)

// Error Handling
setupErrorHandler(app)

// Router Guard
createPermissionGuard(router)

app.use(createPinia())
app.use(router)
app.use(Antd)

app.mount('#app')
